import Introduce from '../view/introduce.vue'
import BaoMing from 'pages/baoMing/baoMing.vue'
import uniPopupShare from '../popup/uni-popup-share.vue'
import HongBao from '../../components/RedPacket/RedPacket.vue'
import RedList from '../view/redList.vue'
import RedPack from '../../components/pupUp/redPack.vue'
import CountDown from '../../components/countDown/countDown.vue'
import Coupon from '../view/coupon.vue'
import PlayVideo from '../../components/playVideo.vue'
import uParse from '../../components/gaoyia-parse/parse.vue'
export default {
	components: {
		Introduce,
		HongBao,
		BaoMing,
		RedList,
		CountDown,
		RedPack,
		uniPopupShare,
		Coupon,
		uParse,
		PlayVideo,

	},

	data() {
		return {
			title: "情",
			bodtyH: (this.WH - this.CustomBar) + 'px',
			dataWeb:"",
			footH: this.CustomBar,
			loadStatus: 'load',
			isLoading: false,
		
		}
	},
	/**初始加载接收参数
	 * @param {Object} option
	 */
	onLoad(option) {
	    console.log("xxx");

		this.loadData(option.id);


	},

	onUnload(e){
		console.log(e);
		
	},
	/**
	 * 分享的操作
	 */
	onShareAppMessage(res) {
		console.log("分享的openid " + this.$openid);
		return {
			title: this.good.title,
			imageUrl: this.good.advertmap[0].url,
			path: '/pages/index/index?courseId=' + this.courseId + '&userCode=' + this.initCode
		}

	},
	onBackPress(options) {
		console.log("点击返回界面");
		console.log(options);
		if (options.from === 'navigateBack') {
			return false;
		}
		this.onreturn();
		return true;
	},
	methods: {
		/**
		 * 点击图片的操作函数
		 */
       preview(){},
	   
	   /**
		* 加载数据
		* @param {Object} id
		*/
		loadData(id) {
			console.log("id  : "+id);
			
			let data = {
				id: id,
			
			};
		
			this.Reques.commonQuest("index/api/detail.html", "POST", data).then((res) => {
				console.log(res);
				if (res.statusCode == 200 && res.data.code == 0) {
					this.isLoading = true;
					
				    this.dataWeb=res.data.data[0];
 
				} else {
					this.loadStatus = 'error2';
				}
			}, (err) => {
				this.loadStatus = 'error2';
				console.log(err);
			});
		

		},
		/**
		 * 回调更新
		 * @param {Object} type
		 */

		upData: function(type) {
			console.log("更新");
			this.isStatus = false;
			this.loadData();

		}

		}


}
